package com.example.seckilldemo.config;

import com.example.seckilldemo.pojo.User;

/**
 * @Author Wangbaba
 * @Date 2024/3/22 1:21
 * @Version 1.0
 */
public class UserContext {

    private static ThreadLocal<User> userHolder = new ThreadLocal<User>();

    public static void setUser(User user) {
        userHolder.set(user);
    }

    public static User getUser() {
        return userHolder.get();
    }
}
